package com.urbane.generator.model.dto;

import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
@Schema(description = "代码生成请求参数")
public class GenStrategyRequest {
    /**
     * 要生成代码的表名列表
     * <p>
     * 支持多个表同时生成代码
     */
    @NotEmpty(message = "至少需要选择一个表进行代码生成")
    @ArraySchema(
            schema = @Schema(
                    description = "表名",
                    example = "user"
            )
    )
    @Schema(
            description = "要生成代码的表名列表",
            requiredMode = Schema.RequiredMode.REQUIRED
    )
    private List<@NotBlank(message = "表名不能为空") String> tableNames;

    /**
     * 表前缀
     * <p>
     * 生成实体类时会自动去除表前缀
     * 示例: 如果表名为 't_user'，表前缀为 't_'，则生成的实体类名为 'User'
     */
    @Schema(
            description = "表前缀",
            example = "t_"
    )
    private String tablePrefix;
}
